﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class Admin_ascx_EditTemplateTest_TwoColumns : System.Web.UI.UserControl,IEditShowTemplate
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    #region IEditShowTemplate 成员

    public void SetField(ConfigColumns cCol, string value, bool isEdit)
    {
        int id = 0;
        int.TryParse(Request.QueryString["id"], out id);
        string sql = "select * from news where id=" + id.ToString();
        DataRow row = DBFactory.GetConn().exeRow(sql);
        if (row != null)
        {
            this.needm.Text = row["needm"].ToString();
            this.addm.Text = row["addm"].ToString();
        }
    }

    public string GetInsertSql(ConfigColumns cCol)
    {
        return Request.Form["needM_EditShow$needm"]+","+Request.Form["needm_EditShow$addm"];
    }

    public string GetInsertSqlBefore(ConfigColumns cCol)
    {
        return "needm,addm";
    }

    public string GetUpdateSql(ConfigColumns cCol)
    {
        return "needm=" + Request.Form["needm_editShow$needm"] + ",addm=" + Request.Form["needm_editshow$addm"];
    }

    #endregion
}
